//报工时
for (var j = 0; j < 2; j++) {
    var tds = $("tbody").children[j].children;
    for (var i = 1; i < tds.length; i++) {
        if(!tds[i].children[0] || !tds[i].children[0].children[0]) {
            continue;
        }
        var span = tds[i].children[0].children[0];
        if(span.className == "ant-checkbox") {
            span.click();
        }
    }
}



document.cookie

function setCookie(str) {
    var array = str.split(";");
    for (var i = 0; i < array.length; i++) {
        if(!array[i]) {
            continue;
        }
        var index = array[i].indexOf("=");
        var cookieName = array[i].substr(0, index);
        var cookieValue = array[i].substr(index + 1);
        var exp = new Date();
        exp.setTime(exp.getTime() + 1000 * 60 * 60 * 24 * 365);
        document.cookie= cookieName + "="+cookieValue+";Path=/;domain=.sinopec.com;expires="+exp.toGMTString();
    }
}

setCookie(
    '_idp_authn_lc_key=dc90432e-98b7-436b-988b-6aae94698a1e; x=x; _saml_idp=YUhSMGNITTZMeTloZFhSb0xuTnBZVzB1YzJsdWIzQmxZeTVqYjIwdmFXUnc%3D; _idp_client_ip=10.238.153.116; x=x; _idp_authn_lc_key=fc45a3ea-90d8-4d51-a46f-cc092dc08f81; JSESSIONID=aIm4mq1io1aW0VmgoNSvdGBTwISt0ryMWV5rf4I7GbheeA-mYGSu!1794888391; JSESSIONID=8ry9xhFh2uIcQx-YiReiPNeISzp7gxKogcYzUvhbT9AHOBqH3DSB!1794888391; saml_idp_token=MTAuMjM4LjE1My4xMTY%3D%7COGFhMmVjNTMzYTRkNDQ0MzY5ZTVkMjlhMTVlYmVhNTlkOTQyNGU3ZWYxMGM5ZjVkZDlhNGJkMTI0NDNjOWEzZA%3D%3D%7C0GKyd9%2B5eSnzmqiVRdTYLpSJ1q8%3D'

)

var interval = setInterval(doTask, 50);
var count = 0;
function doTask() {
    while(new Date().getTime() == new Date("2021-4-6 10:00:00").getTime()) {
        $("#click")[0].click();
        if(coun++ == 10) {
            clearInterval(interval);
        }
        console.log("clicked");
    }
    console.log("over");
}